Utilities Module

History

current version 1.0 - 4th October 2008

version date comment
1.0 04/Oct/2008 Original code

License

license: GNU GPL http://www.gnu.org/licenses/

This file is part of

MOSAICO -- MOdular library for raSter bAsed hydrologIcal appliCatiOn.

Copyright (C) 2011 Giovanni Ravazzani

Code Description

Language: Fortran 90.

Software Standards: "European Standards for Writing and
Documenting Exchangeable Fortran 90 Code".

Module Description:

Collection of general purpose utilities



Interfaces

public interface LinearInterp

  • private function LinearInterpFloatFloat(x1, x2, y1, y2, x) result(y)

    calculates linear interpolation between real numbers.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=float), intent(in) :: x1
    real(kind=float), intent(in) :: x2
    real(kind=float), intent(in) :: y1
    real(kind=float), intent(in) :: y2
    real(kind=float), intent(in) :: x

    Return Value real(kind=float)

  • private function LinearInterpFloatDouble(x1, x2, y1, y2, x) result(y)

    calculates linear interpolation between real numbers. Output is a double real

    Arguments

    Type IntentOptional Attributes Name
    real(kind=float), intent(in) :: x1
    real(kind=float), intent(in) :: x2
    real(kind=double), intent(in) :: y1
    real(kind=double), intent(in) :: y2
    real(kind=float), intent(in) :: x

    Return Value real(kind=double)

  • private function LinearInterpIntFloat(x1, x2, y1, y2, x) result(y)

    calculates linear interpolation between integer numbers with output real.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: x1
    integer, intent(in) :: x2
    real(kind=float), intent(in) :: y1
    real(kind=float), intent(in) :: y2
    integer, intent(in) :: x

    Return Value real(kind=float)


Functions

public function GetUnit() result(iunit)

returns a free FORTRAN unit number Discussion: A "free" FORTRAN unit number is an integer between 1 and 999 which is not currently associated with an I/O device. A free FORTRAN unit number is needed in order to open a file with the OPEN command. If IUNIT = 0, then no free FORTRAN unit could be found, although all 999 units were checked (except for units 5 and 6). Otherwise, IUNIT is an integer between 1 and 99, representing a free FORTRAN unit. Note that GetUnit assumes that units 5 and 6 are special, and will never return those values. Adapted from John Burkardt

Arguments

None

Return Value integer(kind=short)

private function LinearInterpFloatDouble(x1, x2, y1, y2, x) result(y)

calculates linear interpolation between real numbers. Output is a double real

Arguments

Type IntentOptional Attributes Name
real(kind=float), intent(in) :: x1
real(kind=float), intent(in) :: x2
real(kind=double), intent(in) :: y1
real(kind=double), intent(in) :: y2
real(kind=float), intent(in) :: x

Return Value real(kind=double)

private function LinearInterpFloatFloat(x1, x2, y1, y2, x) result(y)

calculates linear interpolation between real numbers.

Arguments

Type IntentOptional Attributes Name
real(kind=float), intent(in) :: x1
real(kind=float), intent(in) :: x2
real(kind=float), intent(in) :: y1
real(kind=float), intent(in) :: y2
real(kind=float), intent(in) :: x

Return Value real(kind=float)

private function LinearInterpIntFloat(x1, x2, y1, y2, x) result(y)

calculates linear interpolation between integer numbers with output real.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: x1
integer, intent(in) :: x2
real(kind=float), intent(in) :: y1
real(kind=float), intent(in) :: y2
integer, intent(in) :: x

Return Value real(kind=float)


Subroutines

public subroutine TimeStamp(unit)

prints the current YMDHMS date as a time stamp. Cursor remains on the same line. Example: 2008-09-29T21:00:25.624+0200

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=short), intent(in) :: unit